package com.kefu.call.vo;

import javax.validation.constraints.Size;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.call.model.CallAvoidDial;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author francis
 * @date 2022/06/19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "免打号码")
public class CallAvoidDialUpdateVo extends AbstractUpdateVo<CallAvoidDial,Long> {

    @NotNull
    @ApiModelProperty(value = "主键")
    private String dialNo;
    @Size(max = 32)
    @ApiModelProperty(value = "电话")
    private String telephone;
    @Size(max = 32)
    @ApiModelProperty(value = "姓名")
    private String name;
    @Size(max = 128)
    @ApiModelProperty(value = "备注")
    private String desb;
    @Size(max = 32)
    @ApiModelProperty(value = "创建人")
    private String createId;

    @Override
    public CallAvoidDial convert() {
        CallAvoidDial info = new CallAvoidDial();
        info.setTelephone(telephone);
        info.setName(name);
        info.setDesb(desb);
        info.setCreateId(createId);
        KefuContext context = KefuContext.getKefuContext();
        info.setDialNo(dialNo);
        return info;
	}
}